#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int main()
    {
        int n;
        cin >> n;
        int flag = 0;
        int numRemain;
        cin >> numRemain;
        for (int i = 0; i < n; ++i)
        {
            for (int j = 0; j < n; ++j)
            {
                if (numRemain == 0)
                {
                    cin >> numRemain;
                    flag = !flag;
                }
                cout << flag;
                --numRemain;
            }
            cout << endl;
        }
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif